* ======================================
* ----------- Import income ------------
* ======================================


	use "$dta_raw\dta9\w19_0078_skatt_pensj.dta", clear
	rename w19 idPers
	rename pensjgiv incomeNOK
	rename aargang year
	keep if year == "2015" | year == "2019"
	destring year, replace
	
	collapse income, by(idPers year)	// take means of duplicate years

	gen incomeUSD = incomeNOK/8.0739/1000  // USD @2015 average (Norges Bank)
	replace incomeUSD = incomeUSD*(100/110.8) if year == 2019 // deflate using cpi (Statistics Norway)
	
	sort idPers year
	save "$dta\ImportIncome.dta",replace
